package cn.myschool.dp;

/**
 * @author oldliu
 * @since 1.0
 */
public class SingleTon {
    private static SingleTon inst;
    private SingleTon(){
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("对象构建完成");
    }
    public static SingleTon get(){
        if(inst==null){
            synchronized (SingleTon.class){
               if(inst==null) {
                   inst = new SingleTon();
               }
            }
        }
        return inst;
    }
}
